package WizardInstall;

import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

class LoginDBPage extends WizardPage {
  public static final String PAGE_NAME = "LoginDatabase";

  private Text textUserName;
  private Text textPassword;
  private Text l3;

  public LoginDBPage() {
    super(PAGE_NAME, "Login Database Page", null);
  }

  public void createControl(Composite parent) {
    Composite topLevel = new Composite(parent, SWT.NONE);
    topLevel.setLayout(new GridLayout(2, false));

    Label l1=new Label(topLevel, SWT.CENTER);
    l1.setText("UserName of Database: ");
    textUserName = new Text(topLevel, SWT.SINGLE);
    textUserName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    
    Label l2=new Label(topLevel, SWT.CENTER);
    l2.setText("Password of Database: ");
    textPassword = new Text(topLevel, SWT.SINGLE  | SWT.PASSWORD);
    textPassword.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    
    l3=new Text(topLevel, SWT.SINGLE);
    l3.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    l3.setEnabled(false);
    
    setControl(topLevel);
    setPageComplete(true);
  }

  public void setError(String strError)
  {
	  l3.setText(strError);
  }
  public String getUserName() {
    return textUserName.getText();
  }
  
  public String getPassword() {
	    return textPassword.getText();
	  }
}


